This is a more advanced demonstration of an “on quit” handler in a script application. This application is a simple database that remembers one piece of data, which can be stored and retrieved from other scripts. When the application quits, if the data has been changed it puts up an alert that allows the user to save the changed data, forget the changes, or cancel the Quit entirely.